{extends file="./main.tpl"}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{block name=head}
<link href="./css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<link href="./css/loan.css" rel="stylesheet" type="text/css" />
{/block}
{block name=body}
<form name="loanForm" id="loanForm" action="{$smarty.server.PHP_SELF}" method="post" enctype="multipart/form-data">
  <table cellpadding="2" cellspacing="0" border="0" align="center">
    <tr>
      <td align="right" valign="top" >
  	    <table cellpadding="2" cellspacing="5" border="0" id="loanTable">
  	      <tr>
  	        <td colspan="6" align="center" class="table1">
  	        	<h1><font size="5px">Loan </font></h1>
  	        </td>
  	      </tr>
          <tr>
            <th colspan="6" rowspan="1" ><font color="green" size="4px">Loan On Gold</font></th>
          </tr>
          <tr>
            <th class="table1">Gross Weight</th>
            <th class="table1">Less</th>
            <th class="table1">Purity</th>
            <th class="table1">fine</th>
            <th class="table1">Rate</th>
            <th class="table1">Value</th>
          </tr>
          <tr>
            <td class="table2" align="center"><input type="text" size="6" name="grossWeight" id="grossWeight" onkeyup="calculatValue();" value="{$editLoanRow['grossWeight']}"></td>
            <td class="table2"><input type="text" size="6" name="less" id="less" value="{$editLoanRow['less']}" onkeyup="calculatValue();"></td>
            <td class="table2" align="center"><input type="text" size="6" name="purity" id="purity" onkeyup="calculatValue();" value="{$editLoanRow['purity']}"></td>
            <td class="table2"><input type="text" size="6" name="fine" id="fine" onkeyup="calculatValue();" value="{$editLoanRow['fine']}"></td>
            <td class="table2"><input type="text" size="6" name="Rate" id="Rate" onkeyup="calculatValue();" value="{$editLoanRow['rate']}"></td>
            <td class="table2"><input type="text" size="6" name="goldValue" id="goldValue" onkeyup="valueTotal();" value="{$editLoanRow['goldValue']}"></td>
          </tr>
          <tr>
            <th colspan="6"><font color="green" size="4px">Loan On Proparty</font></th>
          </tr>
          <tr>
            <th class="table1" colspan="2">Land Value</th>
            <th class="table1" colspan="2">Construction Value</th>
            <th class="table1" colspan="2">Total</th>
          </tr>
          <tr>
            <td colspan="2" class="table2" align="center"><input type="text" size="6" name="landValue" id="landValue" onkeyup="landConstructionTotal();" value="{$editLoanRow['landValue']}"></td>
            <td colspan="2" class="table2" align="center"><input type="text" size="6" name="constructionValue" id="constructionValue" onkeyup="landConstructionTotal();" value="{$editLoanRow['constructionValue']}"></td>
            <td colspan="2" class="table2" align="center"><input type="text" size="6" name="propartyValue" id="propartyValue" onblur="valueTotal();" value="{$editLoanRow['propartyValue']}" /></td>
          </tr>
          <tr><td colspan="6" class="table2">&nbsp</td></tr>
          <tr>
            <th align="right" class="table1">Value : &nbsp</th>
            <td class="table2">&nbsp<input type="text" name="value" size="6" id="value1" placeholder="Value" value="{$editLoanRow['value']}" /></td>
            <th align="right" class="table1">Loan Amount : &nbsp</th>
            <td colspan="3" class="table2">&nbsp<input type="text" size="6" required=required name="loadAmount" id="loanAmount" value="{$editLoanRow['value']}" onblur="countDays();" ></td>
          </tr>
          <tr>
            <th align="right" class="table1" valign="top">Item Image : &nbsp</th>
            <td class="table2">&nbsp<img src="loanUplodeadImages/{$editLoanRow['itemImage']}" width="80px" height="80px"></td>
            <th align="right" class="table1">Item Location : &nbsp</th>
            <td colspan="3" class="table2">&nbsp<input type="text" size="15" required=required name="itemLocation" class="capital" id="itemLocation" value="{$editLoanRow['itemlocationName']}" ></td>
          </tr>
          <tr>
            <th align="right" class="table1">Date : &nbsp</th>
            <td class="table2">&nbsp{$editLoanRow['loanDate']|date_format:"%e-%m-%Y"}</td>
            <th align="right" class="table1">Last Insterest&nbsp&nbsp&nbsp&nbsp Received : &nbsp</th>
            <td class="table2" NOWRAP >&nbsp{$editLoanRow['lastInterestReceiveDate']|date_format:"%e-%m-%Y"}</td>
            <th align="right" class="table1">LoanEnd&nbsp&nbsp&nbsp&nbsp Date : &nbsp</th>
            <td class="table2" nowrap >&nbsp{$editLoanRow['endDate']|date_format:"%e-%m-%Y"}</td>
          </tr>
          <tr>
            <th NOWRAP  align="right" class="table1">Monthly Interest % : &nbsp</th>
            <td class="table2">&nbsp<input type="text" name="monthlyInterest" size="6" value="{$editLoanRow['monthlyInterest']}" id="monthlyInterest" onblur="interest(); "></td>
            <th NOWRAP align="right" class="table1">Monthly Interest Rs : &nbsp</th>
            <td colspan="3" class="table2">&nbsp<input type="text" name="monthlyInterestRs" size="6" value="{$editLoanRow['monthlyInterestRs']}" id="monthlyInterestRs""></td>
          </tr>
          <tr>
            <th colspan="6" rowspan="1"><font color="green" size="4px">Account</font></th>
          </tr>
          <tr>
            <th class="table1" colspan="2">Account</th>
            <th class="table1" colspan="2">Narration</th>
            <th class="table1" colspan="2">Amount</th>
          </tr>
          {section name=sec loop=$transArray}
          <tr class="transactionInRow">
            <td class="table2" align="center" colspan="2">
              <input type="text" name="accountId[]" id="accountId" class="accountId" value="{$transArray[sec]['accountName']}" size="15" />
            </td>
            <td class="table2" colspan="2"><textarea name="amountNarration[]" cols="10">{$transArray[sec]['amountNarration']}</textarea></td>
            <td align="center" class="table2">
              <input type="text" name="amount1[]" id="amount1" size="6" value="{$transArray[sec]['amount1']}" onkeyup="amount();" />
            </td>
            <td align="center" class="table2">
              <input type="text" name="amount2[]" id="amount2" value="{$transArray[sec]['crAmount']}" size="6" />
            </td>
          </tr>
          {/section}
        </table> 
      </td>
      <td align="left" valign="top">
        <table cellpadding="2" cellspacing="3" border="0" >
          <tr>
            <td colspan="2" class="table1">
              <h1 align="center"><font size="5px">Party </font></h1>
            </td>
          </tr>
          <tr class="loanFont">
            <th class="table1" align="right" nowrap >Party Name : &nbsp</th>
            <td class="table2">&nbsp<input type="text" class="capital" required=required  id="guj" name="accountName" size="24" value="{$editLoanRow['accountName']}"></td>
          </tr>
				  <tr class="loanFont">
						<br>
				    <th class="table1" align="right" nowrap >Party Code : &nbsp</th>
				    <td class="table2">&nbsp<input type="text" required=required  name="partyCode" size="24" {if $editLoanRow['partyCode'] != ''} DISABLED {/if} value="{$editLoanRow['partyCode']}"></td>
				  </tr>          
          <tr class="loanFont">
            <th class="table1" align="right" valign="top">Address : &nbsp</th>
            <td class="table2"><textarea cols="19" id="address" class="capital" name="address" rows="6" >{$editLoanRow['address']}</textarea></td>
          </tr>
          <tr class="loanFont">
            <th class="table1" align="right">Mobile : &nbsp</th>
            <td class="table2">&nbsp<input type="text" name="mobile" id="mobile" value="{$editLoanRow['mobile']}" size="24"></td>
          </tr>
          <tr class="loanFont">
            <th class="table1" align="right" valign="top" nowrap >Party Image : &nbsp</th>
            <td class="table2">
              &nbsp{if isset({$selectPartyRow.partyId})}<img src="partyUplodeadImages/{$editLoanRow['photo']}" width="80px" height="80px">{/if}
            </td>
          </tr>
          <tr class="loanFont">
            <th class="table1" align="right" class="capital" valign="top" >Other&nbsp&nbsp&nbsp&nbsp Information : &nbsp</th>
            <td class="table2"><textarea cols="19" id="otherInfo" name="otherInfo" rows="6">{$editLoanRow['otherInfo']}</textarea></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form> 
{/block}